<?php 
class Susers extends E_Entity 
{
	public   $table =array(
					"id" =>"id",
					"version"=>"version",
					 "uid"=>"uid",                          
		              "screen_name"=>"screen_name",                   
		              "name"=>"name",                         
		              "province"=>"province",            
		              "city"=>"city",               
		              "location"=>"location",                     
		              "description"=>"description",         
		              "url"=>"url",                 
		              "profile_image_url"=>"profile_image_url",   
		              "domain"=>"domain",                      
		              "gender"=>"gender",             
		              "followers_count"=>"followers_count",      
		              "friends_count"=>"friends_count",           
		              "statuses_count"=>"statuses_count",          
		              "favourites_count"=>"favourites_count",        
		              "created_at"=>"created_at",              
		              "following"=>"following",             
		              "allow_all_act_msg"=>"allow_all_act_msg",     
		              "geo_enabled"=>"geo_enabled",           
		              "verified"=>"verified",   
					 "token"=>"token",   
					 "token_secret"=>"token_secret",     
					"sign" =>"sign",
					"status" =>"status",
					"ctime" =>"ctime",
					"mtime" =>"mtime"
					);
					
	public function getTableName()
	{
		return "micro_suser";
	}
	public function getJoinMap()
	{
		$map = array("mapSite" =>array("Entity"=>"Sites","Method"=>"getByUserid", "param"=>"id"),
		
		);
		return $map;
	}
	public static function insertEntity($row)
	{	
		$entity = new self();
	 	return $entity->createEntityForRow($row);
	}
	public static function getById($id)
	{
		$entity = new self();
		$sql =  "select * from {$entity->getTableName()} where  {$entity->table['id']} = :id";
		return $entity->getEntityByIndexKey($sql, $id, array("id"=>$id));
	}
	public static function getByUid($uid)
	{
		$entity = new self();
		$sql =  "select * from {$entity->getTableName()} where  {$entity->table['uid']} = :uid";
		return $entity->getEntityByIndexKey($sql, $id, array("uid"=>$uid));
	}
	
}
?>